package com.lwb.ztx.user.presenter;

import android.content.Context;

import com.lwb.ztx.database.greendao.db.Collect;
import com.lwb.ztx.user.model.CollectModel;
import com.lwb.ztx.user.model.CollectModelImpl;
import com.lwb.ztx.user.view.CollectView;

import java.util.List;

/**
 * Created by luweibin on 2016/6/1.
 */
public class CollectPresenterImpl implements CollectPresenter,CollectModelImpl.OnCollectsLoadFinishListener {
    private CollectView collectView;
    private CollectModel collectModel;

    public CollectPresenterImpl(CollectView collectView) {
        this.collectView = collectView;
        collectModel = new CollectModelImpl(this);
    }

    @Override
    public void getCollects(Context context) {
        collectModel.loadCollect(context);
    }

    @Override
    public void deleteCollects(Context context,List<Collect> collectList) {
        collectModel.deleteCollects(context,collectList);
    }

    @Override
    public void onSuccess(List<Collect> collectList) {
        collectView.setCollectNews(collectList);
    }
}
